import datetime
date_time_str = '2018-06-29 08:15:27.243860'
date_time_obj = datetime.datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')
print('Date:', date_time_obj.date())
print('Time:', date_time_obj.time())
print('Date-time:', date_time_obj)
// To convert json datetime string to datetime object in c#
// Try this
// For instance if the json string is in this format: "/Date(1409202000000-0500 )/"
// Then wrap it like below
string sa = @"""/Date(1409202000000-0500)/""";
// Create a new instance of datetime object
DateTime dt = new DateTime();
// Deserialize the json string to datetime object
dt = JsonConvert.DeserializeObject<DateTime>(sa);
// Output
// dt = "2014-08-28 3.00.00 PM"